home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / NET / IRDA / W83977AF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-17  |  827 b   |  55 lines

  1. #ifndef W83977AF_H
  2. #define W83977AF_H
  3.  
  4. #define W977_EFER 0x370
  5. #define W977_EFIR 0x370
  6. #define W977_EFDR 0x371
  7. #define W977_DEVICE_IR 0x06
  8.  
  9.  
  10. /*
  11.  * Enter extended function mode
  12.  */
  13. static inline void w977_efm_enter(void)
  14. {
  15.         outb(0x87, W977_EFER);
  16.         outb(0x87, W977_EFER);
  17. }
  18.  
  19. /*
  20.  * Select a device to configure 
  21.  */
  22.  
  23. static inline void w977_select_device(__u8 devnum)
  24. {
  25.     outb(0x07, W977_EFIR);
  26.     outb(devnum, W977_EFDR);
  27.  
  28. /* 
  29.  * Write a byte to a register
  30.  */
  31. static inline void w977_write_reg(__u8 reg, __u8 value)
  32. {
  33.     outb(reg, W977_EFIR);
  34.     outb(value, W977_EFDR);
  35. }
  36.  
  37. /*
  38.  * read a byte from a register
  39.  */
  40. static inline __u8 w977_read_reg(__u8 reg)
  41. {
  42.     outb(reg, W977_EFIR);
  43.     return inb(W977_EFDR);
  44. }
  45.  
  46. /*
  47.  * Exit extended function mode
  48.  */
  49. static inline void w977_efm_exit(void)
  50. {
  51.     outb(0xAA, W977_EFER);
  52. }
  53. #endif
  54.